import axios from 'axios'


// axios.defaults.headers.get['content-type'] = 'application/json'

// axios.interceptors.request.use(request => {
// 	// console.log(request)
// })

// console.log(axios.defaults.headers.get)

const api = {
	fetchLogs() {
		var http = axios.create({
			timeout: 1000
			// headers: {'Content-Type': 'application/json'}
		})



		http.get('http://localhost:8080/solr/tasklog', {
			params: {
				index: 2
			},
			data: {}
		}).then(res => {
			// console.log(res)
		}).catch(err => {
			console.log('error')
			console.error(err)
		})
	},
	async asyncFetchLogs(cb) {
		let data = await axios.get('http://localhost:8080/solr/tasklog');
		cb(data)
	}
}

export default api